package cn.lg.soar.cms.biz.modules.article.entity;

import cn.lg.soar.cms.api.enums.CommentStatusEnum;
import cn.lg.soar.core.annotations.constraints.group.Create;
import cn.lg.soar.core.annotations.constraints.group.Update;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.time.LocalDateTime;


/**
 * 文章评论
 * @author luguoxiang
 * @since 2025-02-23
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Data
@Schema(description = "文章评论")
@TableName("lg_cms_article_comment")
public class ArticleComment {

    /**  */
    @NotNull(message = "主键不能为空", groups = { Update.class })
    @ExcelIgnore
    @Schema(description = "主键")
    @TableId
    private Long id;

    /** 回复评论id（顶级0） */
    @NotNull(message = "回复评论id（顶级0）不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "回复评论id（顶级0）")
    @Schema(description = "回复评论id（顶级0）")
    private Long parentId;

    /** 文章id */
    @NotNull(message = "文章id不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "文章id")
    @Schema(description = "文章id")
    private Long articleId;

    /** 用户id */
    @NotNull(message = "用户id不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "用户id")
    @Schema(description = "用户id")
    private Long userId;

    /** 评论内容 */
    @NotBlank(message = "评论内容不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "评论内容")
    @Schema(description = "评论内容")
    private String content;

    /** 评论时间 */
    @NotNull(message = "评论时间不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "评论时间")
    @Schema(description = "评论时间")
    private LocalDateTime time;

    /** 点赞数 */
    @NotNull(message = "点赞数不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "点赞数")
    @Schema(description = "点赞数")
    private Integer likes;

    @ExcelProperty(value = "回复数")
    @Schema(description = "回复数")
    private Integer replies;

    @ExcelProperty(value = "状态")
    @Schema(description = "状态")
    private CommentStatusEnum status;

    @ExcelProperty(value = "置顶排序（默认：255，越小越靠前）")
    @Schema(description = "置顶排序（默认：255，越小越靠前）")
    private Integer pinOrder;
}
